import numpy as np
y_true = np.array([2,4,6])
y_pred = np.array([1,1,1])
u = ((y_true - y_pred)**2).sum()
v = ((y_true - y_true.mean())**2).sum()
print(u)
print(v)
r2 = 1 - u/v
print(f"r2: {r2}")